app.factory("CookApi",['ApiUtil',function(ApiUtil){
    return {
    	toggleCookActive: function(params){
    		return ApiUtil.get('/api/cooks/changeStatus', params);
    	},
    	loadCitys: function(pid){
    		return ApiUtil.get('/api/citys',{parentId: pid});
    	},
    	loadCountry: function(pid){
    		return ApiUtil.get('/apicp/common/regions/index',{pid: pid})
    	},
    	getRoleInfo: function(){
    		return ApiUtil.get('/api/login/userInfo');
    	},
    	getAreas: function(){
    		return ApiUtil.get('/api/areaManager/administrativeArea');
    	},
        getCookList: function(params){
            return ApiUtil.get('/api/cooks/', params);
        },
        delCook: function(coId){
            return ApiUtil.delete('/api/cooks/'+coId);
        },
    	storeCook: function(params){
    		return ApiUtil.post('/api/cooks/', params);
    	},
    	updateCook: function(coId, params){
    		return ApiUtil.put('/api/cooks/'+coId, params);
    	},
    	cookInfo: function(coId){
    		return ApiUtil.get('/api/cooks/'+coId);
    	}
    };
}]);